<?php
$lia->gotoWithContent($package->url('/login/'));
$core = $package->compo('Core');
$email = $_POST['email'];
$user = $core->userFromEmail($email);
if (!$user->isGuest()){
$code = $core->newActivationCode($user);
$url = $package->get('Site.url').$package->url("/reset-password/{$code}/");
$message = 'To reset your password for '.$package->get('Site.name').' visit <a href="'.$url.'">'.$url.'</a>';
$core->sendEmail([
'to'=>$user->email,
'to.name'=>$user->name,
'subject'=>'Password Reset',
'message'=>$message,
]);
}
?>
<p>If an account exists for <strong><?=$email?></strong>, then an email has been sent with a password reset link.</p>
<p>If you haven't received the email in a couple minutes <a href="<?=$package->url('/reset-password/');?>">try again</a> or contact <a href="mailto:<?=$package->get('Support.email');?>"><?=$package->get('Support.name');?></a></p>
<?php
return;
echo "An email has been sent to <strong>".$data['email']."</strong>. Click the link in your email to set a new password.";
//Maybe give a link to the home page or something??
if ($success){
$sys->sendActivationEmail($_POST['email'],$activation);
} else {
$sys->sendActivationFailureEmail($_POST['email']);
}